home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_654_114 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-12  |  1.1 KB  |  49 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.amitavaplay == true)
  3.    {
  4.       if(_root.level == 5)
  5.       {
  6.          if(st == 1)
  7.          {
  8.             att = true;
  9.             st = 0;
  10.          }
  11.       }
  12.       if(att == true)
  13.       {
  14.          dx = _X - _root.tank._x;
  15.          dy = _Y - _root.tank._y;
  16.          d = Math.sqrt(dx * dx + dy * dy);
  17.          if(100 < d)
  18.          {
  19.             rad = Math.atan2(dy,dx) + 3.141592653589793;
  20.             deg = rad * 180 / 3.141592653589793;
  21.             _rotation = deg;
  22.             b = speed * Math.cos(rad);
  23.             p = speed * Math.sin(rad);
  24.             _X = _X + b;
  25.             _Y = _Y + p;
  26.             treadcheckb++;
  27.             if(5 < treadcheckb)
  28.             {
  29.                treadcountb++;
  30.                duplicateMovieClip(_root.treadb,"treadb" + treadcountb,16384 + (treadcountb % 800 + 8000));
  31.                treadcheckb = 0;
  32.             }
  33.          }
  34.          else if(0 < _root.amithealth)
  35.          {
  36.             this.gotoAndStop(2);
  37.          }
  38.          else
  39.          {
  40.             this.gotoAndStop(1);
  41.          }
  42.       }
  43.    }
  44.    else
  45.    {
  46.       this.gotoAndStop(1);
  47.    }
  48. }
  49.